<template>
  <div class="mui-pages" style="background-color: #fff;">
    <header class="mui-bar mui-bar-nav flex-justify-start">
      <span @click="fn.back()" class="mui-action-back"><img class="back-btn" src="../../../static/images/back.png"></span>
      <h1 class="mui-title">组织结构</h1>
    </header>
    <div class="message-tab people-header">
      <div class="header-search all-search">
        <input type="search" v-model="searchName" name="" placeholder="请输入党员名称搜索" />
        <i class="people-search"></i>
      </div>
    </div>
    <div class="mui-scroll-wrapper mui-page-content mui-pages">
      <div class="mui-scroll-wrapper">
        <div class="mui-scroll">
          <ul class="work-message-lists people-lists">
            <li @click="selected(item)" v-if="item.name.indexOf(searchName)>=0" v-for="item in list" class="flex-between-center ">
              <div class="flex-justify-start">
                <div class="people-lists-touxiang"></div>
                <p>{{item.name}}</p>
              </div>
              <h5>{{item.maxRoleTypeName}}</h5>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import footerbar from '@/components/layout/footerbar.vue'
  import tools from '@/utils/tools'
  import loginService from '@/service/loginService'
  import moment from 'moment'
  export default {
    components: {
      footerbar
    },
    name: '',
    data () {
      return {
        fn: tools,
        tabIndex: 0,
        options: {
          pullUpLoad: true,
          scrollbar: false
        },
        searchName: '',
        loading: false,
        list: [],
        infinite: true,
      }
    },
    created () {
      this.loadData()
    },
    methods: {
      getPartyMembers () {
        let data = {
          dataScope: 3,
          partyGroupId: this.$store.state.userInfo.partyMemberModel.partyGroupId
        }
        loginService.getPartyMembers(data).then((res) => {
          if (res.code === 200) {
            this.list = res.data
          }
        })
      },
      loadData () {
        this.getPartyMembers()
      }
    }
  }
</script>
